Skip to content

EyalDelarea/JFrog-Frogbot-Demo

Repository files navigation

JFrog Frogbot

frogbot-intro

Scanned by Frogbot Go Report Card

Branch Status
master Build status GitHub Action Test
dev Build status GitHub Action Test

Table of contents

🤖 About JFrog Frogbot

Overview

JFrog Frogbot is a Git bot that scans your git repositories for security vulnerabilities.

  • Frogbot scans pull requests right after they are opened, but before they are merged. This unique capability ensures that the code is scanned and can be fixed even before vulnerabilities are introduced in the code base.
  • Frogbot scans the Git repository periodically and creates pull requests with fixes for vulnerabilities that are detected.

Frogbot uses JFrog's vast vulnerabilities database, to which we continuously add new component vulnerability data. Also included is VulnDB, the industry's most comprehensive security database, to further extend the range of vulnerabilities detected and fixed by Frogbot.

Frogbot supports the following Git providers:

  • Azure Repos
  • Bitbucket Server
  • GitHub
  • GitLab.

What's needed for the setup?

  • Frogbot uses a JFrog environment to scan your Git repositories. If you don't have a JFrog environment, you can set up one for free, and use it with no limits.

  • Frogbot also requires a runtime environment for the scanning. The following environments are supported:

    • GitHub Actions
    • JFrog Pipelines
    • Jenkins
    • Azure Pipelines

🖥️ Installing Frogbot

Step 1 - Optionally set up a FREE JFrog Environment in the Cloud

Frogbot requires a JFrog environment to scan your projects. If you don't have an environment, we can set up a free environment in the cloud for you. Just run one of the following commands in your terminal to set up an environment in less than a minute.

The commands will do the following:

  1. Install JFrog CLI on your machine.
  2. Create a FREE JFrog environment in the cloud for you.

For macOS and Linux, use curl

curl -fL "https://getcli.jfrog.io?setup" | sh

For Windows, use PowerShell

powershell "Start-Process -Wait -Verb RunAs powershell '-NoProfile iwr https://releases.jfrog.io/artifactory/jfrog-cli/v2-jf/[RELEASE]/jfrog-cli-windows-amd64/jf.exe -OutFile $env:SYSTEMROOT\system32\jf.exe'" ; jf setup

After the setup is complete, you'll receive an email with your JFrog environment connection details, which can be stored as secrets in Git.

Step 2 - Create the frogbot-config.yml file if needed
Step 3 - Install Frogbot

🚥 Using Frogbot

Scanning pull requests

General

Frogbot uses JFrog Xray (version 3.29.0 and above is required) to scan your pull requests. It adds the scan results as a comment on the pull request. If no new vulnerabilities are found, Frogbot will also add a comment, confirming this.

Supported package management tools:

  • Go
  • Gradle
  • Maven
  • .NET
  • npm
  • NuGet
  • Pip
  • Pipenv
  • Poetry
  • Yarn 2

How to use Pull Request scanning?

Azure Repos

After you create a new pull request, Frogbot will automatically scan it.

NOTE: The scan output will include only new vulnerabilities added by the pull request. Vulnerabilities that aren't new, and existed in the code before the pull request was created, will not be included in the report. In order to include all the vulnerabilities in the report, including older ones that weren't added by this PR, use the includeAllVulnerabilities parameter in the frogbot-config.yml file.

The Frogbot Azure Repos scan workflow is:

  1. The developer opens a pull request.
  2. Frogbot scans the pull request and adds a comment with the scan results.
  3. Frogbot can be triggered again following new commits, by adding a comment with the rescan text.
Bitbucket Server

After you create a new pull request, Frogbot will automatically scan it.

NOTE: The scan output will include only new vulnerabilities added by the pull request. Vulnerabilities that aren't new, and existed in the code before the pull request was created, will not be included in the report. In order to include all of the vulnerabilities in the report, including older ones that weren't added by this PR, use the includeAllVulnerabilities parameter in the frogbot-config.yml file.

The Frogbot scan on Bitbucket Server workflow:

  1. The developer opens a pull request.
  2. Frogbot scans the pull request and adds a comment with the scan results.
  3. Frogbot can be triggered again following new commits, by adding a comment with the rescan text.
GitHub

After you create a new pull request, the maintainer of the Git repository can trigger Frogbot to scan the pull request from the pull request UI.

NOTE: The scan output will include only new vulnerabilities added by the pull request. Vulnerabilities that aren't new, and existed in the code before the pull request was created, will not be included in the report. In order to include all of the vulnerabilities in the report, including older ones that weren't added by this PR, use the includeAllVulnerabilities parameter in the frogbot-config.yml file.

The Frogbot GitHub scan workflow is:

  1. The developer opens a pull request.
  2. The Frogbot workflow automatically gets triggered and a GitHub environment named frogbot becomes pending for the maintainer's approval.

  1. The maintainer of the repository reviews the pull request and approves the scan:
  2. Frogbot can be triggered again following new commits, by repeating steps 2 and 3.
GitLab

After you create a new merge request, the maintainer of the Git repository can trigger Frogbot to scan the merge request from the merge request UI.

NOTE: The scan output will include only new vulnerabilities added by the merge request. Vulnerabilities that aren't new, and existed in the code before the merge request was created, will not be included in the report. In order to include all of the vulnerabilities in the report, including older ones that weren't added by this merge request, use the includeAllVulnerabilities parameter in the frogbot-config.yml file.

The Frogbot GitLab flow is as follows:

  1. The developer opens a merge request.
  2. The maintainer of the repository reviews the merge request and approves the scan by triggering the manual frogbot-scan job.
  3. Frogbot is then triggered by the job, it scans the merge request, and adds a comment with the scan results.
  4. Frogbot can be triggered again following new commits, by triggering the frogbot-scan job again. GitLab CI Run Button

👮 Security note for pull requests scanning

When installing Frogbot using JFrog Pipelines, Jenkins and Azure DevOps, Frogbot will not wait for a maintainer's approval before scanning newly opened pull requests. Using Frogbot with these platforms, however, isn't recommended for open-source projects.

When installing Frogbot using GitHub Actions and GitLab however, Frogbot will initiate the scan only after it is approved by a maintainer of the project. The goal of this review is to ensure that external code contributors don't introduce malicious code as part of the pull request. Since this review step is enforced by Frogbot when used with GitHub Actions and GitLab, it is safe to be used for open-source projects.

Scan results

Frogbot adds the scan results to the pull request in the following format:

👍 No issues

If no new vulnerabilities are found, Frogbot automatically adds the following comment to the pull request:

👎 Issues were found

If new vulnerabilities are found, Frogbot adds them as a comment on the pull request. For example:

SEVERITY DIRECT
DEPENDENCIES
DIRECT
DEPENDENCIES
VERSIONS
IMPACTED
DEPENDENCY
NAME
IMPACTED
DEPENDENCY
VERSION
FIXED
VERSIONS
CVE

Critical
lion-webview v0.1.20 ten-webpack v4.75.0 [v4.76.0] CVE-2023-28154

High
magic-streaming-server v0.21.10 ten-webpack v4.75.0 [v4.76.0] CVE-2023-28154

High
jump-archiver v3.5.1 quicksilver v5.75.0 [v5.76.0] CVE-2023-28154

Medium
expense-calculator v6.6.0 cve-alpha v1.10.0 [v1.10.1] CVE-2023-28154

Scanning repositories and fixing issues

Frogbot scans your Git repository and automatically opens pull requests for upgrading vulnerable dependencies to a version with a fix.

For GitHub repositories, Frogbot also adds Security Alerts which you can view in the GitHub UI:

Frogbot uses JFrog Xray for the scanning. The scanning is triggered following commits that are pushed to the repository.

Supported package management tools:

  • Go
  • Maven
  • npm
  • Pip
  • Pipenv
  • Poetry
  • Yarn 2

📛 Adding the Frogbot badge

You can show people that your repository is scanned by Frogbot by adding a badge to the README of your Git repository.

Scanned by Frogbot

You can add this badge by copying the following markdown snippet and pasting it into your repository's README.md file.

[![Scanned by Frogbot](https://raw.github.com/jfrog/frogbot/master/images/frogbot-badge.svg)](https://github.com/jfrog/frogbot#readme)

🔥 Reporting issues

Please help us improve Frogbot by reporting issues you encounter.

💻 Contributions

We welcome pull requests from the community. To help us improve this project, please read our Contribution guide.

About

Demo of JFrog Frogbot capabilities

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages